package com.irenty.effectivej.ch02.objectreation;

import java.util.logging.Logger;

import org.testng.annotations.Test;


/*
 * Item 2: Consider a builder when faced with many constructor parameters
 */
public class BuilderPatternTest {
	private final static Logger LOGGER = Logger.getLogger(BuilderPatternTest.class.getName());
	
	@Test
	public void testNutritionBuilder() throws Exception {
		NutritionFacts cocaCola = new NutritionFacts.Builder(240, 8).
				calories(100).sodium(35).carbohydrate(27).build();
		// build method can check the invariants
		
		LOGGER.info("coca cola nutrition facts is: " + cocaCola);
	}
	
	
}
